<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head th:replace="layouts::header"></head>

<body>
<nav th:replace="layouts::navbar"></nav>
<div class="container">
    <h3>管理员信息</h3>
    <hr>
    <!--新增学生按钮-->
    <a th:href="@{/userAccounts/new}" class="btn btn-primary btn-sm mb-3">新增管理员</a>
    <br>
    <table class="table table-bordered table-striped">
        <thead class="thread-dark">
        <tr>
            <th>管理员昵称</th>
            <th>管理员性别</th>
            <th>管理员工号</th>
            <th>动作</th>
        </tr>
        </thead>
        <tbody>
        <tr th:each="aUserAccount : ${userAccounts}">
            <td th:text="${aUserAccount.userName}"></td>
            <td th:text="${aUserAccount.gender}"></td>
            <td th:text="${aUserAccount.password}"></td>
            <td>
                <a th:href="@{/userAccounts/update(id=${aUserAccount.userAccountId})}" class="btn btn-info btn-sm">更新</a>
                <a
                        th:href="@{/userAccounts/delete(id=${aUserAccount.userAccountId})}"
                        class="btn btn-danger btn-sm"
                        onclick="if(!(confirm('确定删除该管理员吗'))) return false"
                >删除</a>
            </td>
        </tr>
        </tbody>
    </table>
</div>
</body>
</html>